/*
 * ProgressStatusConnection.h
 *
 *  Created on: Dec 25, 2014
 *      Authors: Avihay Avitan & Stefan Farcas
 */

#ifndef PROGRESSSTATUSSUPPLIERCONNECTION_H_
#define PROGRESSSTATUSSUPPLIERCONNECTION_H_
#include <zmq.hpp>
#include "ProgressMessage.pb.h"
#include <string>
#include <iostream>
#include "AllUtils.h"
#include "../CoreSettings/CoreSettings.h"
using namespace progress_message;
using namespace zmq;
using namespace std;
using namespace SettingsSpace;

namespace ProgressStatusSpace {
/**
 * ProgressStatusConnection provides the connection mechanism for the progress status module.
 */
class ProgressStatusConnection {
public:
	ProgressStatusConnection();
	virtual ~ProgressStatusConnection();

	bool connectAsSubscriber();
	bool connectAsPublisher();

	bool sendProgressMessage(ProgressMessage  * msg);
	bool receiveProgressMessage(ProgressMessage * recived);

private:
	context_t *context ;
	socket_t *socket ;


};

} /* namespace ProgressStatusConnection */

#endif /* PROGRESSSTATUSSUPPLIERCONNECTION_H_ */
